package com.it.dao;


import com.it.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    int AddUser(User user);

    int DeleteUser(Integer id);


    int UpdateUser(User user);


    User SelectById(Integer id);

    List<User> SelectAll(@Param("PageNum") Integer PageNum, @Param("PageSize") Integer PageSize, @Param("username") String username);

    Integer SelectTotal();

    User SelectUser(@Param("username") String username, @Param("password") String password);

    @Select("select sex,count(sex) num from user group by sex ")
    List<User> SelectRatio();

    @Select("select address,count(address) num from user group by address ")
    List<User> SelectAddress();
}
